﻿using UnityEngine;
using System.Globalization;

public class SoarDMath
{
    public static double Lerp(double a, double b, float t)
    {
        if (t < 0) t = 0;
        if (t > 1) t = 1;
        return (b - a) * t + a;
    }

    public static Vector3 Lerp(Vector3 start, Vector3 target, float deltaTime, float timeTotal)
    {
        return Vector3.Lerp(start, target, deltaTime / timeTotal);
    }

    public static Color Lerp(Color start, Color target, float deltaTime, float timeTotal)
    {
        return Color.Lerp(start, target, deltaTime / timeTotal);
    }

    public static float Distance(float x, float y)
    {
        x = Mathf.Abs(x);
        y = Mathf.Abs(y);
        int min = (int)(Mathf.Min(x, y) * 1000);
        int dis = min >> 1 + min >> 2 - min << 4;
        return x + y - dis / 1000.0f;
    }

    private const char CHAR_B = 'B';
    private const char CHAR_M = 'M';
    private const char CHAR_K = 'K';
    private const char CHAR_ADD = '+';
    public static string ConvertNumberWithUnit(int num, bool addSymbol = false)
    {
        return "";
    }
}
